﻿using UnityEngine;
using System.Collections;
namespace com.stanwind.unity3d{
	public class Stan:MonoBehaviour{
		public static Stan _ins;
		public StanImpl stanUtils;
		public GameObject stan;

		void Awake(){
			#if UNITY_IOS
				stanUtils = new IOSImpl();
			#elif UNITY_ANDROID
				stanUtils = new AndrImpl();
			#endif

			_ins = this;
			//新建监听Obj
			stan = new GameObject ("Stan");
			//增加监听脚本组件
			stan.AddComponent<StanListener>();
		}

		public void openPhotoLibrary(){
			#if UNITY_ANDROID
				stanUtils.OpenPhoto();
			#elif UNITY_EDITOR
				Debug.Log("测试图片处理");
				//测试图片处理
				stan.GetComponent<StanListener>().PhotoCallBack("/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAATU0AKgAAAAgAAgESAAMAAAABAAEAAIdpAAQAAAABAAAAJgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAgKADAAQAAAABAAAAgAAAAAD/7QA4UGhvdG9zaG9wIDMuMAA4QklNBAQAAAAAAAA4QklNBCUAAAAAABDUHYzZjwCyBOmACZjs+EJ+/8AAEQgAgACAAwEiAAIRAQMRAf/EAB8AAAEFAQEBAQEBAAAAAAAAAAABAgMEBQYHCAkKC//EALUQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+v/EAB8BAAMBAQEBAQEBAQEAAAAAAAABAgMEBQYHCAkKC//EALURAAIBAgQEAwQHBQQEAAECdwABAgMRBAUhMQYSQVEHYXETIjKBCBRCkaGxwQkjM1LwFWJy0QoWJDThJfEXGBkaJicoKSo1Njc4OTpDREVGR0hJSlNUVVZXWFlaY2RlZmdoaWpzdHV2d3h5eoKDh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